package org.gpp.proj1.robot.action;

import java.util.LinkedList;

import junit.framework.TestCase;

import org.gpp.proj1.robot.action.step.ActionStep;

public class PartActionTest extends TestCase {

	/*
	 * Test method for 'org.gpp.proj1.robot.action.PartAction.PartAction(String, List<ActionStep>)'
	 */
	public void testPartAction() {
		// Cannot create action with null name
		try {
			new PartAction( null, new LinkedList<ActionStep>() );
			fail();
		} catch (AssertionError e) {
			// Expected error
		}
		
		// Cannot create action with null step list
		try {
			new PartAction( "action", null );
			fail();
		} catch (AssertionError e) {
			// Expected error
		}
		
		// Valid construct
		try {
			new PartAction( "action", new LinkedList<ActionStep>() );
		} catch (AssertionError e) {
			fail();
		}
	}

	/*
	 * Test method for 'org.gpp.proj1.robot.action.PartAction.getName()'
	 */
	public void testGetName() {
		PartAction action = new PartAction( "action", new LinkedList<ActionStep>() );
		
		assertNotNull( action.getName() );
		assertEquals( "action", action.getName() );
	}

	/*
	 * Test method for 'org.gpp.proj1.robot.action.PartAction.getSteps()'
	 */
	public void testGetSteps() {
		PartAction action = new PartAction( "action", new LinkedList<ActionStep>() );
		
		assertNotNull( action.getSteps() );
	}

}
